package cn.com.connext.scrm.domain.master;

import cn.com.connext.scrm.domain.enumeration.DeleteStatus;
import cn.com.connext.scrm.domain.enumeration.MemberStatus;
import com.connext.common.domain.UUIDDomain;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.ZonedDateTime;

@Entity
@Table(name = "member")
public class Member implements UUIDDomain, Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private String id;

    @Column(name = "account")
    @Size(max = 20)
    private String account;

    @Column(name = "open_id", nullable = false, length = 50)
    @Size(max = 50)
    private String openId;

    @Column(name = "union_id", nullable = false, length = 50)
    @Size(max = 50)
    private String unionId;

    @Column(name = "mobile", nullable = false, length = 20)
    @Size(max = 20)
    private String mobile;

    @Column(name = "nick_name", length = 50)
    @Size(max = 50)
    private String nickName;

    @Column(name = "gender")
    private Integer gender;

    @Column(name = "head_img_url", length = 200)
    @Size(max = 200)
    private String headImgUrl;

    @Column(name = "is_frozen", nullable = false)
    private Boolean isFrozen = false;

    @Column(name = "is_adult", nullable = false)
    private Boolean isAdult;

    @Column(name = "province_id", length = 50)
    @Size(max = 50)
    private String provinceId;

    @Column(name = "city_id", length = 50)
    @Size(max = 50)
    private String cityId;

    @Column(name = "district_id", length = 50)
    @Size(max = 50)
    private String districtId;

    @Enumerated(EnumType.STRING)
    @Column(name = "status", nullable = false)
    private MemberStatus status = MemberStatus.ACTIVATED;

    @Column(name = "create_time")
    private ZonedDateTime createTime;

    @Column(name = "update_time")
    private ZonedDateTime updateTime;

    @Column(name = "created_index")
    private Long createdIndex;

    @Column(name = "is_banned")
    private Boolean isBanned = false;

    @Column(name = "official_certification")
    private Boolean officialCertification = false;

    @Column(name = "source")
    private String source;

    @Column(name = "content_name")
    private  String contentName;

    @Column(name="membership_id")
    private String membershipId;

    @Column(name="province")
    private String province;
    @Column(name="city")
    private String city;
    @Column(name="address")
    private String address;
    @Column(name = "birthday")
    private ZonedDateTime birthday;
    @Column(name="telephone")
    private String telephone;
    @Column(name="sku_id")
    private String skuId;

    public String getSkuId() {
        return skuId;
    }

    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public ZonedDateTime getBirthday() {
        return birthday;
    }

    public void setBirthday(ZonedDateTime birthday) {
        this.birthday = birthday;
    }

    public String getMembershipId() {
        return membershipId;
    }

    public void setMembershipId(String membershipId) {
        this.membershipId = membershipId;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getContentName() {
        return contentName;
    }

    public void setContentName(String contentName) {
        this.contentName = contentName;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl;
    }

    public Boolean getFrozen() {
        return isFrozen;
    }

    public void setFrozen(Boolean frozen) {
        isFrozen = frozen;
    }

    public Boolean getAdult() {
        return isAdult;
    }

    public void setAdult(Boolean adult) {
        isAdult = adult;
    }

    public String getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getDistrictId() {
        return districtId;
    }

    public void setDistrictId(String districtId) {
        this.districtId = districtId;
    }

    public MemberStatus getStatus() {
        return status;
    }

    public void setStatus(MemberStatus status) {
        this.status = status;
    }

    public ZonedDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(ZonedDateTime createTime) {
        this.createTime = createTime;
    }

    public ZonedDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(ZonedDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Long getCreatedIndex() {
        return createdIndex;
    }

    public void setCreatedIndex(Long createdIndex) {
        this.createdIndex = createdIndex;
    }

    public Boolean getBanned() {
        return isBanned;
    }

    public void setBanned(Boolean banned) {
        isBanned = banned;
    }

    public Boolean getOfficialCertification() {
        return officialCertification;
    }

    public void setOfficialCertification(Boolean officialCertification) {
        this.officialCertification = officialCertification;
    }

    @Override
    public String toString() {
        return "Member{" +
            "id='" + id + '\'' +
            ", account='" + account + '\'' +
            ", openId='" + openId + '\'' +
            ", unionId='" + unionId + '\'' +
            ", mobile='" + mobile + '\'' +
            ", nickName='" + nickName + '\'' +
            ", gender=" + gender +
            ", headImgUrl='" + headImgUrl + '\'' +
            ", isFrozen=" + isFrozen +
            ", isAdult=" + isAdult +
            ", provinceId='" + provinceId + '\'' +
            ", cityId='" + cityId + '\'' +
            ", districtId='" + districtId + '\'' +
            ", status=" + status +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", createdIndex=" + createdIndex +
            ", isBanned=" + isBanned +
            ", officialCertification=" + officialCertification +
            ", source='" + source + '\'' +
            ", contentName='" + contentName + '\'' +
            ", membershipId='" + membershipId + '\'' +
            ", province='" + province + '\'' +
            ", city='" + city + '\'' +
            ", address='" + address + '\'' +
            ", birthday=" + birthday +
            ", telephone='" + telephone + '\'' +
            ", skuId='" + skuId + '\'' +
            '}';
    }
}
